//
//  SAPFindCarTableViewCell.m
//  CarsHome
//
//  Created by dapeng on 15/12/4.
//  Copyright © 2015年 dapeng. All rights reserved.
//

#import "SAPFindCarTableViewCell.h"
#include "Theme-PrefixHeader.pch"
@implementation SAPFindCarTableViewCell
- (void)dealloc {
    
    [_carImage release];
    [_carName release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.carImage = [[UIImageView alloc] init];
        self.carName = [[UILabel alloc] init];
        [_carImage release];
        [_carName release];
        [self addSubview:self.carImage];
        [self addSubview:self.carName];
        [_carImage release];
        [_carName release];
      
    }return self;
}


- (void)layoutSubviews {
    [super layoutSubviews];
    self.carImage.frame = CGRectMake(10, 10, 44, 44);
    self.carName.frame = CGRectMake(64, 0, 100, 64);
}

- (void)setThreeModel:(SAPFindCarThreeModel *)threeModel {
    if (_threeModel != threeModel) {
        [_threeModel release];
        _threeModel = [threeModel retain];
    }
    [self.carImage sd_setImageWithURL:[NSURL URLWithString:threeModel.imgurl]];
    self.carName.text = threeModel.name;
    
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *passWord = [user objectForKey:@"nightModel"];
    
    if (!(passWord == nil) && [passWord isEqualToString:@"day"]) {
        self.backgroundColor = [UIColor colorWithWhite:0.126 alpha:1.000];
        self.carName.textColor = RGB(153.0,153.0,153.0,1.0f);
        
    }else{
        self.backgroundColor = [UIColor whiteColor];
        
    }
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
